﻿#region License statement
// NJamb, a specification and delta-specification DSL
// Copyright (c) 2010-2011, Mark Knell
// Published under the MIT License; all other rights reserved
#endregion

#region using...
using System;
using NUnit.Framework;
#endregion

namespace NJamb.DemoCode.Antipatterns
{
	[TestFixture]
	public class TypewashedFalsePass
	{
		[Test]
		public void Changed()
		{
			// arrange
			var foo = new Foo {ExpensiveString = new Lazy<string>(() => "bar")};
			string originalValue = foo.ExpensiveString.Value;

			// act
			foo.Frob();

			// assert
			Assert.That(foo.ExpensiveString, Is.Not.EqualTo(originalValue));
		}

		public class Foo
		{
			public Lazy<string> ExpensiveString { get; set; }
			public void Frob() {}
		}
	}
}
